﻿package xzl.edu.cn.set;

import java.util.ArrayList;
import java.util.Iterator;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class BookManger {
	public static void main(String args[]) {
		Logger logger=LogManager.getLogger(BookManger.class); 
		Book book1=new Book("Linux程序设计","Black",66.6);
		Book book2=new Book("Windows程序设计", "Blue", 99.9);
		Book book3=new Book("Englidh","Red",70.0);
		ArrayList<Book> books=new ArrayList<Book>();
		books.add(book1); /** add three books*/
		books.add(book2);
		books.add(book3);
	    Iterator<Book> it1=books.iterator();/**迭代器*/
		while(it1.hasNext()) {
			Book book=it1.next();
			logger.info(book);
		}
		logger.info("*******************");/**分隔符*/
		books.remove(1); /**删除第二本书*/
		Iterator<Book> it2=books.iterator();
		while(it2.hasNext()) {
			Book book=it2.next();
			logger.info(book);
		}
	}
}